package org.unicat.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.unicat.model.User;
import org.unicat.model.UserInfo;
import org.unicat.service.UserRegistService;

@Controller
@RequestMapping("/regist")
public class RegisterController {

    @Autowired
    UserRegistService userRegistService;

    @RequestMapping("/page")
    public String registPage(Model model){
        return "register";
    }

    @RequestMapping("/user")
    public String regist(UserInfo userInfo, Model model){

        ModelAndView modelAndView = new ModelAndView();

        System.out.println(userInfo);
        userRegistService.UserRegist(userInfo);

        return "index";
    }


}
